I have a series of 5 validation scripts that can now be run from a menu within the module. |
Re: Creating a Report
I guess the easiest way to show your results (a string i guess?) on the screen is create a small dialog:
string reportString = "
This is my {\\b report}.
It has {\\i very cewl } data in it and can also use bold,
italics { \\ul underlined } text!
"
DB x = centered "Report Results"
richText (x, "Copy this data where you like to have it", richText reportString , 300,300, true)
show x
|
Re: Creating a Report Mathias Mamsch - Fri Mar 19 10:48:41 EDT 2010
I guess the easiest way to show your results (a string i guess?) on the screen is create a small dialog:
string reportString = "
This is my {\\b report}.
It has {\\i very cewl } data in it and can also use bold,
italics { \\ul underlined } text!
"
DB x = centered "Report Results"
richText (x, "Copy this data where you like to have it", richText reportString , 300,300, true)
show x
Thanks for responding btw. |
Re: Creating a Report simon.gwilliam - Fri Mar 19 11:00:10 EDT 2010
Just a few more lines ... you can copy/paste a lot of the DOORS dxl help file. Regards, Mathias
DBE rt
void storeData(DBE bt) {
// basic file name
DB storer = centered ("Choose a location")
DBE fn = fileName(storer, "input.dat")
block storer
release storer
string file = get fn
if (!canOpenFile(file, true)) { ack "Cannot open file " file "\n"; return }
Stream outStream = write file
string result = get rt
outStream << result
close outStream
}
string reportString = "
This is my {\\b report}.
It has {\\i very cewl } data in it and can also use bold,
italics { \\ul underlined } text!
"
DB x = centered "Report Results"
rt = richText (x, "Copy this data where you like to have it", richText reportString , 300,300, true)
button (x, "Save to file", storeData)
show x
|
Re: Creating a Report Not sure what you are asking, but the following will output the contents of a buffer to a text file and display it with Notepad.exe.
//*************************
bool fFileMessage(Buffer bufContents, string NameFile, bool DisplayFile)
{ // Put string FileContents in the NameFile and optionally display it with Notepad.exe
// FileContents must already be formatted if at all.
// Return true if it appears to have worked.
Stream Output
noError()
Output = write(NameFile)
string ErrMess = lastError()
if (!null Output and null ErrMess)
{ Output << bufContents
close Output
if (DisplayFile)
system("Notepad.exe " NameFile)
return(true)
}
else
{ return(false)
}
} // end fFileMessage()
//*************************
bool fFileMessage(Buffer bufContents)
{ // Overloaded, get a temp file name and yes display the file
return(fFileMessage(bufContents, tempFileName(), true))
} // end overloaded fFileMessage(temp file)s
Buffer buf = create
buf = "(((("
fFileMessage(buf)
delete(buf)
|